export default class ContinuationClick {
  constructor(needCount) {
    this.needCount = needCount
    this.count = 0
    this.lastTime = null
  }

  click() {
    if (this.count) {
      if (Date.now() - this.lastTime > 300) {
        this.count = 0
        // console.log('guoshi')
        return
      }
    } else {
      this.isFinished = false
    }
    this.lastTime = Date.now()
    this.count++

    if (this.count >= this.needCount) {
      this.isFinished = true
      this.count = 0
    }
    // console.log(this.count, this.isFinished)
  }
}
